using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualBasic;
using Microsoft.Win32;
using System.IO;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Web;

namespace FSHelperLib
{

    public class SystemHelper
    {
        // Methods
        public SystemHelper()
        {

        }
        public static string GetAssemblyVersion(Assembly asm)
        {

            FileVersionInfo info1 = FileVersionInfo.GetVersionInfo(asm.Location);

            return info1.ProductVersion;

        }

        public static string GetWebRootFolder(Assembly ExecutableAssembly)
        {

            //Debug.Assert(IsWebApplication()); can be called frm installer or tester 

            string sPath = ExecutableAssembly.Location;

            //remove assembly name

            sPath = sPath.Remove(sPath.LastIndexOf(@"\"), sPath.Length - sPath.LastIndexOf(@"\"));

            //remove BIN folder name

            if ((sPath.ToUpper().EndsWith(@"\BIN")))//15/6/2006
            {

                sPath = sPath.Remove(sPath.LastIndexOf(@"\"), sPath.Length - sPath.LastIndexOf(@"\"));

            }

            Debug.Assert(Directory.Exists(sPath));

            //Debug.Assert(sPath==System.AppDomain.CurrentDomain.BaseDirectory);//can be called frm installer or tester 

            return sPath;

        }



        //'Addition to math.Max

    }

}

